<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      html,
      body {
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
      }
      iframe {
        width: 100%;
        height: 100%;
      }

      .table {
        /* min-width: 150px; */
        width: 150px;
      }

      .td {
        width: 50px;
      }

      table td {
        background: red;
      }

      .nowrap {
        white-space: nowrap;
      }

      .textLeft {
        text-align: left;
      }
    </style>
  </head>
  <body>
    <iframe frameborder="0" src="temp.html"> </iframe>
    <table>
      <th>
        <tr>
          <td width="120px">1</td>
          <td width="150px">2</td>
        </tr>
      </th>
    </table>
    <table>
      <th>
        <tr>
          <td width="100">1</td>
          <td width="150">2</td>
        </tr>
        <tr>
          <td width="200"><input type="text" /></td>
          <td width="250"><select name="" id=""></select></td>
        </tr>
      </th>
    </table>
    <div id="d1" name="nnn" style="height:3000px;">
      <!--注释-->
      这是一个div
      <div class="aaa" name="bbb"></div>
    </div>
    <form action="">
      <input type="text" name="" id="" />
      <button type="submit">submit</button>
    </form>

    <table class="table">
      <thead>
        <tr>
          <td>1</td>
          <td>2</td>
        </tr>
      </thead>
      <tbody class="td">
        <tr>
          <td class="td nowrap"><input type="text" class="" /><span>123456</span><img src="./finshare.ico" alt="" /></td>
          <td>123</td>
        </tr>
      </tbody>
    </table>

    <table>
      <tr>
        <td>
          <a href="#">
            <img src="resources/DEMOBK/images/icons/spin_up_over.gif" name="imgSpinup" width="15" height="8" alt="" />
          </a>
        </td>
      </tr>
      <tr>
        <td>
          <a href="#">
            <img src="resources/DEMOBK/images/icons/spin_up_over.gif" name="imgSpinup" width="15" height="8" alt="" />
          </a>
        </td>
      </tr>
    </table>

    <table>
      <tr>
        <td>
          <a href="#">
            <div style="width: 10px;height: 5px;"></div>
          </a>
        </td>
      </tr>
      <tr>
        <td>
          <a href="#">
            <img src="resources/DEMOBK/images/icons/spin_up_over.gif" name="imgSpinup" width="15" height="8" alt="" />
          </a>
        </td>
      </tr>
    </table>

    <script>
      console.log('compatMode:' + window.document.compatMode);
      console.log('body.clientHeight:' + window.document.body.clientHeight);
      console.log('body.scrollTop:' + window.document.body.scrollTop);
      console.log('documentElement.clientHeight:' + window.document.documentElement.clientHeight);
      console.log('documentElement.scrollHeight:' + window.document.documentElement.scrollHeight);

      var d1 = document.getElementById('d1');
      d1.addEventListener('click', even => {
        console.log(even.clientY);
        console.log(window.document.documentElement.scrollTop);
      });
      console.log(d1.childNodes);
      console.log(d1.childNodes[2]);
      console.log(d1.childNodes[2].nodeType);
      console.log(d1.childNodes[3]);
      console.log(d1.childNodes[3].nodeType);

      function aa() {
        var cb = function() {
          setTimeout(() => {
            console.log('has callback');
            return true;
          }, 3000);
        };

        if (bb(cb)) {
          console.log('has callback');
        } else {
          console.log('no callback');
        }
      }

      function bb(callback) {
        if (callback) {
          callback();
        }
      }

      aa();
    </script>
  </body>
</html>
